#include "test.h"

Test::Test(QObject *parent) : QObject(parent)
{
    connect(&m_process, SIGNAL(bytesWritten(qint64)), SLOT(onBytesWritten(qint64)));
    connect(&m_process, SIGNAL(channelReadyRead(int)), SLOT(onChannelReadyRead(int)));
    connect(&m_process, SIGNAL(readyRead()),  SLOT(onReadyRead()));

    m_process.start("/tmp/test.sh");
}

void Test::onBytesWritten(qint64 i)
{
    qDebug("%s(%s)[%d] %d", __FILE__, __func__, __LINE__, i);
}

void Test::onChannelReadyRead(int i)
{
    qDebug("%s(%s)[%d] %d", __FILE__, __func__, __LINE__, i);
}

void Test::onReadyRead()
{
    qDebug("%s(%s)[%d] %s", __FILE__, __func__, __LIm_processrocess.readAll().data());
}
